<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="applicable-device" content="mobile">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <link rel="Bookmark" href="../imgs/bai.ico"/>
    <link rel="Shortcut Icon" href="../imgs/bai.ico"/>
    <title>家政</title>
    <style type="text/css">
        body { margin: 0; }
        /*首页*/
        #list { padding: 10px 5%; width: 90%; height: 100vh; background: #F9F9F9; }
        #list .box { margin-bottom: 10px; width: 100%; height: 220px; background: #FFFFFF; border: 1px solid #DDD; border-radius: 5px; box-shadow: 0 0 5px #CCC; overflow: hidden; }
        #list .img { width: 100%; height: 100px; background: #EEEEEE; overflow: hidden; }
        #list img { width: 100%; }
        #list .title { padding: 0 10px; padding-top: 5px; font-size: 14px; color: #000; font-weight: bolder; }
        #list .desc { padding: 0 10px; padding-top: 5px; font-size: 12px; color: #888; }
        #list .gsprice { padding: 0 20px; color: #888; text-decoration: line-through; }
        #list .price { padding: 0 10px; padding-top: 5px; font-size: 12px; color: #0088CC; }
        #list .toOne { padding: 10px; padding-top: 5px; font-weight: bolder; font-size: 12px; color: #0088CC; }
    </style>
</head>
<body>
    <!--列表-->
    <div id="list">
        <!--<div class="box">-->
            <!--<div class="img"></div>-->
            <!--<div class="title">项目名称</div>-->
            <!--<div class="price">项目价格</div>-->
            <!--<div class="gsprice">市场价格</div>-->
            <!--<div class="desc">项目描述</div>-->
        <!--</div>-->
    </div>

    <span id="msgPop"></span>
</body>
</html>


<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/view.js"></script>
<script type="text/javascript">
    var cw = document.documentElement.clientWidth;
    var ch = document.documentElement.clientHeight;
    (function () {
        getList();
    })();
    function getList(){
        $.ajax({
            type: apis.fuwuList.method,
            url: apis.fuwuList.url,
            data: {},
            success: function (res) {
                console.log(res);
                if (res.code != 0) {
                    console.log(res.msg);
                }
                var d = res.data;
                var h = '', i;
                for (i = 0; i < d.length; i ++) {
                    h += '<div class="box" onclick="window.location.href=\'one.html?id=' + d[i].id + '\';">';
                    h += '<div class="img">';
                    if (d[i].thumb == '') {
                        h += '';
                    } else {
                        h += '<img src="' + d[i].prefixUrl + d[i].thumb + '"/>';
                    }
                    h += '</div>';
                    h += '<div class="title">【' + d[i].type_name + '】' + d[i].title + '</div>';
                    h += '<div class="price">';
                    h += '参考价：￥' + d[i].price;
                    h += '<span class="gsprice">市场价：￥' + d[i].gsprice + '</span>';
                    h += '</div>';
                    h += '<div class="desc">' + d[i].cnt + '</div>';
                    h += '<div class="toOne">点击进入详情</div>';
                    h += '</div>';
                }
                $('#list').html(h);
            },
            error: function () {
                console.log('网络错误');
            }
        });
    }
</script>